﻿using System;
using System.Threading;

namespace HslCommunication.Core.Net
{
	/// <summary>
	/// 异步消息的对象
	/// </summary>
	// Token: 0x0200014A RID: 330
	internal class StateOneBase
	{
		/// <summary>
		/// 本次接收或是发送的数据长度
		/// </summary>
		// Token: 0x170005A5 RID: 1445
		// (get) Token: 0x06001CA6 RID: 7334 RVA: 0x0008CBA5 File Offset: 0x0008ADA5
		// (set) Token: 0x06001CA7 RID: 7335 RVA: 0x0008CBAD File Offset: 0x0008ADAD
		public int DataLength { get; set; } = 32;

		/// <summary>
		/// 已经处理的字节长度
		/// </summary>
		// Token: 0x170005A6 RID: 1446
		// (get) Token: 0x06001CA8 RID: 7336 RVA: 0x0008CBB6 File Offset: 0x0008ADB6
		// (set) Token: 0x06001CA9 RID: 7337 RVA: 0x0008CBBE File Offset: 0x0008ADBE
		public int AlreadyDealLength { get; set; }

		/// <summary>
		/// 操作完成的信号
		/// </summary>
		// Token: 0x170005A7 RID: 1447
		// (get) Token: 0x06001CAA RID: 7338 RVA: 0x0008CBC7 File Offset: 0x0008ADC7
		// (set) Token: 0x06001CAB RID: 7339 RVA: 0x0008CBCF File Offset: 0x0008ADCF
		public ManualResetEvent WaitDone { get; set; }

		/// <summary>
		/// 缓存器
		/// </summary>
		// Token: 0x170005A8 RID: 1448
		// (get) Token: 0x06001CAC RID: 7340 RVA: 0x0008CBD8 File Offset: 0x0008ADD8
		// (set) Token: 0x06001CAD RID: 7341 RVA: 0x0008CBE0 File Offset: 0x0008ADE0
		public byte[] Buffer { get; set; }

		/// <summary>
		/// 是否发生了错误
		/// </summary>
		// Token: 0x170005A9 RID: 1449
		// (get) Token: 0x06001CAE RID: 7342 RVA: 0x0008CBE9 File Offset: 0x0008ADE9
		// (set) Token: 0x06001CAF RID: 7343 RVA: 0x0008CBF1 File Offset: 0x0008ADF1
		public bool IsError { get; set; }

		/// <summary>
		/// 错误消息
		/// </summary>
		// Token: 0x170005AA RID: 1450
		// (get) Token: 0x06001CB0 RID: 7344 RVA: 0x0008CBFA File Offset: 0x0008ADFA
		// (set) Token: 0x06001CB1 RID: 7345 RVA: 0x0008CC02 File Offset: 0x0008AE02
		public string ErrerMsg { get; set; }
	}
}
